<?php

namespace falcon5\inc\Pages;

use falcon5\inc\Api\Callbacks\AdminCallbacks;
use falcon5\inc\Api\SettingsApi;
use falcon5\inc\Base\BaseAdminPage;

/**
 * @desc setting page
 * Class Settings
 * @package falcon5\inc\Pages
 */
class Settings extends BaseAdminPage
{

    public function register()
    {
        $this->settings_api = new SettingsApi();

        $this->callbacks = new AdminCallbacks();

        $this->setPages();

        $this->settings_api->addPages($this->pages)->withSubPage(falcon5_lang('Setting'))->register();
    }

    public function setPages()
    {
        $this->pages = array(
            array(
                'page_title' => falcon5_lang('Falcon5'),
                'menu_title' => falcon5_lang('Falcon5'),
                'capability' => 'manage_options',
                'menu_slug' => PageSlugConstants::SETTINGS_SLUG,
                'callback' => array( $this->callbacks, 'settings' ),
                'icon_url' => 'dashicons-translation',
            )
        );
    }
}